package com.cdfahe.gms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cdfahe.gms.mybatis.entity.Drugtype;
import com.cdfahe.gms.mybatis.entity.DrugtypeExample;
import com.cdfahe.gms.mybatis.mapper.DrugtypeMapper;
import com.cdfahe.gms.service.IDrugTypeService;
@Service
public class DrugTypeServiceImpl implements IDrugTypeService{
	@Resource
	private DrugtypeMapper drugtypeMapper;
	@Override
	public List<Drugtype> getAllDrugTyes() {
		DrugtypeExample example = new DrugtypeExample();
		example.setOrderByClause("name");
		return drugtypeMapper.selectByExample(example);
	}

	@Override
	public List<Drugtype> selectDrugByExample(DrugtypeExample example) {
		return drugtypeMapper.selectByExample(example);
	}

	@Override
	public String getDrugTypeNameById(int drugtypeid) {
		return drugtypeMapper.selectByPrimaryKey(drugtypeid).getName();
	}

}
